package com.belizer.pay.service;

import org.springframework.http.ResponseEntity;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

public interface WxPayService {
    String nativePay(String description,String orderId,Integer totalFee);

    Map<String,Object> appPay(String description, String orderId, Integer totalFee);

    Map<String,Object> queryOrderByOutTradeNo(String orderId);

    ResponseEntity handleCallback(HttpServletRequest request);

    Map<String,Object> refund(String transactionId,String orderId,Long refundAmount,Long orderAmount);

    ResponseEntity handleRefuseCallback(HttpServletRequest request);

    Map<String,Object> queryRefund(String outRefundNo);

    Map<String,Object> getAccessToken(String authorizationCode);

    Map<String,Object> getUserInfo(String accessToken,String openid);

    /**
     * 单笔转账
     * @param withdrawNo 转账单号
     * @param amount 金额 转账金额单位为“分”
     * @param openid 收款方 openid
     * @param userName  收款方真实姓名。支持标准RSA算法和国密算法，公钥由微信侧提供
     * 明细转账金额<0.3元时，不允许填写收款用户姓名
     * 明细转账金额 >= 2,000元时，该笔明细必须填写收款用户姓名
     * 同一批次转账明细中的姓名字段传入规则需保持一致，也即全部填写、或全部不填写
     * 若商户传入收款用户姓名，微信支付会校验用户openID与姓名是否一致，并提供电子回单
     * @return 单笔转账申请响应
     */
    Map<String,Object> singleTransfer(String withdrawNo,Long amount,String openid,String userName);

    Map<String,Object> getTransferDetailByNo(String wxBatchId,String wxDetailId);

    Map<String,Object> getTransferDetailByNo(String withdrawNo);

}
